package com.foreknow.demo3;

import com.foreknow.demo2.Dog;
import com.foreknow.demo2.Pet;

/**
 * 引用类型的转换
 */
public class TestConvert {
    public void m1(double d) {
        int k = (int) d;
        System.out.println(k);
    }

    public void m2(Pet pet) {
        Dog d = (Dog) pet;
    }

    public static void main(String[] args) {
        TestConvert testConvert = new TestConvert();
        testConvert.m1(1);
        Dog dog = new Dog();
        testConvert.m2(dog);
    }
}
